Supplementary Information 2
Commands used for DE using baySeq (R in Linux)

For 2-way DE 

#to load baySeq
library(baySeq)

#parallel processing
if(require("parallel")) cl <- makeCluster(16) else cl <- NULL

#to read count data matrix in csv
df <- read.csv("numreads.csv",header=TRUE)

#to include transcript length 
seglens <- read.csv("effectiveLength.csv", header=T)

#assign replicates; example only 
replicates <- c("AC","AC","AS","AS")

#assign non-DE and DE
groups <- list(NDE=c(1,1,1,1), DE = c(1,1,2,2))

#include lengths, replicates, and matrix 
CD <- new("countData", data = as.matrix(df[,2:5]), replicates = replicates, seglens = seglens, groups = groups)

#adding annotation details
CD@annotation <- data.frame(name = df[1])

#removing low count reads
CD1 <- CD[rowSums(CD@data)>ncol(CD),]

#normalizing library size using edgeR-based TMM as scaling factor
libsizes(CD1) <- getLibsizes(CD1, estimationType = "edgeR")

#Prior calculations
CD1 <- getPriors.NB(CD1, cl = cl)

#posterior likelihood calculations
CD1 <- getLikelihoods(CD1,  nullData = TRUE, cl = cl)

#generating normalized data output and saving them as a table
table = topCounts(CD1, group="DE", number=nrow(df), normaliseData=TRUE)
write.table(table, file = "apoControlvsStress_DEncol.txt", col.names = T, row.names = T, sep = "\t")

table = topCounts(CD1, group="NDE", number=nrow(df), normaliseData=TRUE)
write.table(table, file = "apoControlvsStress_NDEncol.txt", col.names = T, row.names = T, sep = "\t")


For other models/structures (explanation similar above): 

library(baySeq)
if(require("parallel")) cl <- makeCluster(16) else cl <- NULL
df <- read.csv("overallDE_numreads.csv",header=TRUE)
seglens <- read.csv("effectiveLength.csv", header=T)
replicates <- c("IC","IC","IS","IS","AC","AC","AS","AS")
groups <- list(NDE=c(1,1,1,1,1,1,1,1),GDE=c(1,1,1,1,2,2,2,2),DDE= c(1,1,2,2,1,1,3,3),RDE = c(1,1,2,2,3,3,4,4))
CD <- new("countData", data = as.matrix(df[,2:9]), replicates = replicates, seglens = seglens, groups = groups)
CD@annotation <- data.frame(name = df[1])
CD1 <- CD[rowSums(CD@data)>12,]
libsizes(CD1) <- getLibsizes(CD1, estimationType = "edgeR")
CD1 <- getPriors.NB(CD1, cl = cl)
CD1 <- getLikelihoods(CD1, nullData = TRUE, cl = cl)
table = topCounts(CD1, group="DE", number=nrow(df), normaliseData=TRUE)
write.table(table, file = "apoControlvsStress_DEncol.txt", col.names = T, row.names = T, sep = "\t")

where:
NDE <- c(1,1,1,1,1,1,1,1) #Capture genes that don't change throughout
GDE <- c(1,1,1,1,2,2,2,2) #Capture overall differences between IR64 and Apo regardless of the conditions 
DDE <- c(1,1,2,2,1,1,3,3) #Capture differences that arise between IR64 and Apo under drought
DE <- c(1,1,2,2,3,3,4,4) #capture residual difference between groups

